from marshmallow import Schema, fields # type: ignore

class DataSchema(Schema):
    id = fields.Int(dump_only=True)  # 如果id是只读的（如自增主键）
    name = fields.Str(required=True)  # required=True 表示必填字段
    yuanbao = fields.Str(allow_none=True)  # 允许为空
    jinbi = fields.Str(allow_none=True)
    beizhu = fields.Str(allow_none=True)
    jointime = fields.DateTime()
    
data_schema = DataSchema()
datas_schema = DataSchema(many=True)